Use g_autoptr(GPtrArray) instead of gs_unref_ptrarray
authorMatthew Barnes <mbarnes@redhat.com>
Tue, 5 May 2015 15:44:40 +0000 (11:44 -0400)
committerMatthew Barnes <mbarnes@redhat.com>
Thu, 7 May 2015 02:07:10 +0000 (22:07 -0400)
31 files changed:
src/libostree/ostree-bootloader-grub2.c
src/libostree/ostree-bootloader-syslinux.c
src/libostree/ostree-bootloader-uboot.c
src/libostree/ostree-core.c
src/libostree/ostree-repo-commit.c
src/libostree/ostree-repo-libarchive.c
src/libostree/ostree-repo-prune.c
src/libostree/ostree-repo-static-delta-compilation-analysis.c
src/libostree/ostree-repo-static-delta-compilation.c
src/libostree/ostree-repo-static-delta-core.c
src/libostree/ostree-rollsum.c
src/libostree/ostree-sysroot-cleanup.c
src/libostree/ostree-sysroot-deploy.c
src/libostree/ostree-sysroot.c
src/libotutil/ot-gio-utils.c
src/libotutil/ot-unix-utils.c
src/ostree/ot-admin-builtin-deploy.c
src/ostree/ot-admin-builtin-diff.c
src/ostree/ot-admin-builtin-status.c
src/ostree/ot-admin-builtin-undeploy.c
src/ostree/ot-admin-functions.c
src/ostree/ot-admin-instutil-builtin-grub2-generate.c
src/ostree/ot-admin-instutil-builtin-selinux-ensure-labeled.c
src/ostree/ot-admin-instutil-builtin-set-kargs.c
src/ostree/ot-builtin-diff.c
src/ostree/ot-builtin-pull-local.c
src/ostree/ot-builtin-pull.c
src/ostree/ot-builtin-static-delta.c
src/ostree/ot-main.c
tests/test-mutable-tree.c
tests/test-ot-unix-utils.c

index d002995365dc560bd4d152aeb1cde0a12999063f..a2d823749584e7e3ff60b48ac2fd5a4a1fc49a54 100644 (file)
@@ -138,7 +138,7 @@ _ostree_bootloader_grub2_generate_config (OstreeSysroot                 *sysroot
   gboolean ret = FALSE;
   GString *output = g_string_new ("");
   g_autoptr(GOutputStream) out_stream = NULL;
-  gs_unref_ptrarray GPtrArray *loader_configs = NULL;
+  g_autoptr(GPtrArray) loader_configs = NULL;
   guint i;
   gsize bytes_written;
   gboolean is_efi;
@@ -304,7 +304,7 @@ _ostree_bootloader_grub2_write_config (OstreeBootloader      *bootloader,
   if (ostree_sysroot_get_booted_deployment (self->sysroot) == NULL
       && g_file_has_parent (self->sysroot->path, NULL))
     {
-      gs_unref_ptrarray GPtrArray *deployments = NULL;
+      g_autoptr(GPtrArray) deployments = NULL;
       OstreeDeployment *tool_deployment;
       g_autoptr(GFile) tool_deployment_root = NULL;
 
index 72d9d1fca3abd9550eb7009da05c99662aff710e..3ed431a367524aeeea21a0a7a0101edc48682573 100644 (file)
@@ -68,7 +68,7 @@ append_config_from_boostree_loader_entries (OstreeBootloaderSyslinux  *self,
                                         GError               **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *boostree_loader_configs = NULL;
+  g_autoptr(GPtrArray) boostree_loader_configs = NULL;
   guint i;
 
   if (!_ostree_sysroot_read_boot_loader_configs (self->sysroot, bootversion, &boostree_loader_configs,
@@ -125,8 +125,8 @@ _ostree_bootloader_syslinux_write_config (OstreeBootloader          *bootloader,
   g_autoptr(GFile) new_config_path = NULL;
   g_autofree char *config_contents = NULL;
   g_autofree char *new_config_contents = NULL;
-  gs_unref_ptrarray GPtrArray *new_lines = NULL;
-  gs_unref_ptrarray GPtrArray *tmp_lines = NULL;
+  g_autoptr(GPtrArray) new_lines = NULL;
+  g_autoptr(GPtrArray) tmp_lines = NULL;
   g_autofree char *kernel_arg = NULL;
   gboolean saw_default = FALSE;
   gboolean regenerate_default = FALSE;
index 00ec2d6921ca78d742e48da94176d5c153aa0326..6cdeec82c98898e9755017761bdc5c7949a4d156 100644 (file)
@@ -70,7 +70,7 @@ create_config_from_boot_loader_entries (OstreeBootloaderUboot     *self,
                                         GCancellable          *cancellable,
                                         GError               **error)
 {
-  gs_unref_ptrarray GPtrArray *boot_loader_configs = NULL;
+  g_autoptr(GPtrArray) boot_loader_configs = NULL;
   OstreeBootconfigParser *config;
   const char *val;
 
@@ -111,7 +111,7 @@ _ostree_bootloader_uboot_write_config (OstreeBootloader          *bootloader,
   g_autoptr(GFile) new_config_path = NULL;
   g_autofree char *config_contents = NULL;
   g_autofree char *new_config_contents = NULL;
-  gs_unref_ptrarray GPtrArray *new_lines = NULL;
+  g_autoptr(GPtrArray) new_lines = NULL;
 
   /* This should follow the symbolic link to the current bootversion. */
   config_contents = gs_file_load_contents_utf8 (self->config_path, cancellable, error);
index 09d3d58fb550ae9324366ea7d11b0d19e67c0d67..84924c6876372d0aafcb77eebd502fd83ceb3f55 100644 (file)
@@ -428,7 +428,7 @@ ostree_raw_file_to_content_stream (GInputStream       *input,
   gsize header_size;
   g_autoptr(GInputStream) ret_input = NULL;
   gs_unref_variant GVariant *file_header = NULL;
-  gs_unref_ptrarray GPtrArray *streams = NULL;
+  g_autoptr(GPtrArray) streams = NULL;
   g_autoptr(GOutputStream) header_out_stream = NULL;
   g_autoptr(GInputStream) header_in_stream = NULL;
 
index 62e3f78c26431aa709d72b9c4398ceb7d61afdc1..afd854ed4501a371466d5f3f6d63f009b4f240ec 100644 (file)
@@ -380,7 +380,7 @@ add_size_index_to_metadata (OstreeRepo        *self,
       OstreeContentSizeCacheEntry *e_size = NULL;
       GVariantBuilder index_builder;
       guint i;
-      gs_unref_ptrarray GPtrArray *sorted_keys = NULL;
+      g_autoptr(GPtrArray) sorted_keys = NULL;
       
       g_hash_table_iter_init (&entries, self->object_sizes);
       g_variant_builder_init (&index_builder,
index e55e6f4afd1f747d8a4c0bd8401feb2508dda27b..e86e40267effd87017f60abf8a4a7f8a2ced6111 100644 (file)
@@ -123,8 +123,8 @@ write_libarchive_entry_to_mtree (OstreeRepo           *self,
   const char *hardlink;
   const char *basename;
   g_autoptr(GFileInfo) file_info = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
-  gs_unref_ptrarray GPtrArray *hardlink_split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
+  g_autoptr(GPtrArray) hardlink_split_path = NULL;
   glnx_unref_object OstreeMutableTree *subdir = NULL;
   glnx_unref_object OstreeMutableTree *parent = NULL;
   glnx_unref_object OstreeMutableTree *hardlink_source_parent = NULL;
index b0dc8a669676827014ee71c78789999fe8d3a878..d9d0b52f8485679e6e24fe5a9d8339095cdc8b68 100644 (file)
@@ -220,7 +220,7 @@ ostree_repo_prune (OstreeRepo        *self,
         goto out;
     }
 
-  { gs_unref_ptrarray GPtrArray *deltas = NULL;
+  { g_autoptr(GPtrArray) deltas = NULL;
     guint i;
 
     if (!ostree_repo_list_static_delta_names (self, &deltas,
index a1344e3bdcf95863dce814d68f40f5b13c60c213..a8f24b438ec768ddd9d759457853a2cb6016b503 100644 (file)
@@ -153,7 +153,7 @@ build_content_sizenames_filtered (OstreeRepo              *repo,
                                   GError                 **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *ret_sizenames =
+  g_autoptr(GPtrArray) ret_sizenames =
     g_ptr_array_new_with_free_func (_ostree_delta_content_sizenames_free);
   g_autoptr(GHashTable) sizenames_map =
     g_hash_table_new_full (g_str_hash, g_str_equal, NULL, _ostree_delta_content_sizenames_free);
@@ -233,8 +233,8 @@ _ostree_delta_compute_similar_objects (OstreeRepo                 *repo,
   gboolean ret = FALSE;
   g_autoptr(GHashTable) ret_modified_regfile_content =
     g_hash_table_new_full (g_str_hash, g_str_equal, g_free, (GDestroyNotify)g_ptr_array_unref);
-  gs_unref_ptrarray GPtrArray *from_sizes = NULL;
-  gs_unref_ptrarray GPtrArray *to_sizes = NULL;
+  g_autoptr(GPtrArray) from_sizes = NULL;
+  g_autoptr(GPtrArray) to_sizes = NULL;
   guint i, j;
   guint lower;
   guint upper;
index 9f988c6bf609bfe97ab48bbad620c020e788a6a3..d56440cea45924045891eac689fbafb861762a90 100644 (file)
@@ -1249,7 +1249,7 @@ ostree_repo_static_delta_generate (OstreeRepo                   *self,
   guint64 total_compressed_size = 0;
   guint64 total_uncompressed_size = 0;
   gs_unref_variant_builder GVariantBuilder *part_headers = NULL;
-  gs_unref_ptrarray GPtrArray *part_tempfiles = NULL;
+  g_autoptr(GPtrArray) part_tempfiles = NULL;
   gs_unref_variant GVariant *delta_descriptor = NULL;
   gs_unref_variant GVariant *to_commit = NULL;
   g_autofree char *descriptor_relpath = NULL;
index 63e4d7febbce94cdbc86bcd5b32cf3ecb0fb5a9f..9129544daf16e8098203b3597cce8c81270ac405 100644 (file)
@@ -68,7 +68,7 @@ ostree_repo_list_static_delta_names (OstreeRepo                  *self,
                                      GError                     **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *ret_deltas = NULL;
+  g_autoptr(GPtrArray) ret_deltas = NULL;
   g_autoptr(GFileEnumerator) dir_enum = NULL;
 
   ret_deltas = g_ptr_array_new_with_free_func (g_free);
index 17830f5b23f2eb60cb05ba08f44704c7a86d0754..5efb193db662184aec24a4c435217b84f5a56ef5 100644 (file)
@@ -114,7 +114,7 @@ _ostree_compute_rollsum_matches (GBytes                           *from,
   OstreeRollsumMatches *ret_rollsum = NULL;
   g_autoptr(GHashTable) from_rollsum = NULL;
   g_autoptr(GHashTable) to_rollsum = NULL;
-  gs_unref_ptrarray GPtrArray *matches = NULL;
+  g_autoptr(GPtrArray) matches = NULL;
   const guint8 *from_buf;
   gsize from_len;
   const guint8 *to_buf;
index 5b8062ac5b5efb191b38c9b22aa2e650f2563ea1..3d322b2e9396d9417b8cabb14875cc84781e4a21 100644 (file)
@@ -99,7 +99,7 @@ list_all_deployment_directories (OstreeSysroot       *self,
   gboolean ret = FALSE;
   g_autoptr(GFileEnumerator) dir_enum = NULL;
   g_autoptr(GFile) deploydir = NULL;
-  gs_unref_ptrarray GPtrArray *ret_deployments = NULL;
+  g_autoptr(GPtrArray) ret_deployments = NULL;
   GError *temp_error = NULL;
 
   deploydir = g_file_resolve_relative_path (self->path, "ostree/deploy");
@@ -186,7 +186,7 @@ list_all_boot_directories (OstreeSysroot       *self,
   gboolean ret = FALSE;
   g_autoptr(GFileEnumerator) dir_enum = NULL;
   g_autoptr(GFile) boot_ostree = NULL;
-  gs_unref_ptrarray GPtrArray *ret_bootdirs = NULL;
+  g_autoptr(GPtrArray) ret_bootdirs = NULL;
   GError *temp_error = NULL;
 
   boot_ostree = g_file_resolve_relative_path (self->path, "boot/ostree");
@@ -296,8 +296,8 @@ cleanup_old_deployments (OstreeSysroot       *self,
   guint i;
   g_autoptr(GHashTable) active_deployment_dirs = NULL;
   g_autoptr(GHashTable) active_boot_checksums = NULL;
-  gs_unref_ptrarray GPtrArray *all_deployment_dirs = NULL;
-  gs_unref_ptrarray GPtrArray *all_boot_dirs = NULL;
+  g_autoptr(GPtrArray) all_deployment_dirs = NULL;
+  g_autoptr(GPtrArray) all_boot_dirs = NULL;
 
   if (stat ("/", &root_stbuf) != 0)
     {
index 662ef13e2671f12b4df98102a898e8c6e2fd8448..b409a53df521f9b65b30f20c1c5633913eb726ea 100644 (file)
@@ -369,9 +369,9 @@ merge_etc_changes (GFile          *orig_etc,
                    GError        **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *modified = NULL;
-  gs_unref_ptrarray GPtrArray *removed = NULL;
-  gs_unref_ptrarray GPtrArray *added = NULL;
+  g_autoptr(GPtrArray) modified = NULL;
+  g_autoptr(GPtrArray) removed = NULL;
+  g_autoptr(GPtrArray) added = NULL;
   guint i;
   int orig_etc_fd = -1;
   int modified_etc_fd = -1;
@@ -620,7 +620,7 @@ selinux_relabel_dir (OstreeSysroot                 *sysroot,
                      GError                       **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *path_parts = g_ptr_array_new ();
+  g_autoptr(GPtrArray) path_parts = g_ptr_array_new ();
   g_autoptr(GFileInfo) root_info = NULL;
 
   root_info = g_file_query_info (dir, OSTREE_GIO_FAST_QUERYINFO,
@@ -651,7 +651,7 @@ selinux_relabel_file (OstreeSysroot                 *sysroot,
                       GError                       **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *path_parts = g_ptr_array_new ();
+  g_autoptr(GPtrArray) path_parts = g_ptr_array_new ();
   g_autoptr(GFileInfo) file_info = g_file_query_info (path, OSTREE_GIO_FAST_QUERYINFO,
                                                             G_FILE_QUERY_INFO_NOFOLLOW_SYMLINKS,
                                                             cancellable, error);
@@ -1710,7 +1710,7 @@ allocate_deployserial (OstreeSysroot           *self,
   guint i;
   int new_deployserial = 0;
   g_autoptr(GFile) osdir = NULL;
-  gs_unref_ptrarray GPtrArray *tmp_current_deployments =
+  g_autoptr(GPtrArray) tmp_current_deployments =
     g_ptr_array_new_with_free_func (g_object_unref);
 
   osdir = ot_gfile_get_child_build_path (self->path, "ostree/deploy", osname, NULL);
@@ -1922,7 +1922,7 @@ ostree_sysroot_deployment_set_kargs (OstreeSysroot     *self,
 {
   gboolean ret = FALSE;
   guint i;
-  gs_unref_ptrarray GPtrArray *new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
+  g_autoptr(GPtrArray) new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
   glnx_unref_object OstreeDeployment *new_deployment = NULL;
   __attribute__((cleanup(_ostree_kernel_args_cleanup))) OstreeKernelArgs *kargs = NULL;
   g_autofree char *new_options = NULL;
index 20573f8df3239854207d6faf2404f762c706fd85..2970d9ef8c6a311e42f9219fb904b4903ba56775 100644 (file)
@@ -372,7 +372,7 @@ _ostree_sysroot_read_boot_loader_configs (OstreeSysroot *self,
   gboolean ret = FALSE;
   int fd; /* Temporary owned by iterator */
   g_autofree char *entries_path = g_strdup_printf ("boot/loader.%d/entries", bootversion);
-  gs_unref_ptrarray GPtrArray *ret_loader_configs = NULL;
+  g_autoptr(GPtrArray) ret_loader_configs = NULL;
   g_auto(GLnxDirFdIterator) dfd_iter = { 0, };
 
   if (!ensure_sysroot_fd (self, error))
@@ -740,8 +740,8 @@ ostree_sysroot_load (OstreeSysroot  *self,
   guint i;
   int bootversion = 0;
   int subbootversion = 0;
-  gs_unref_ptrarray GPtrArray *boot_loader_configs = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) boot_loader_configs = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
 
   g_clear_pointer (&self->deployments, g_ptr_array_unref);
   g_clear_pointer (&self->booted_deployment, g_object_unref);
@@ -1215,8 +1215,8 @@ ostree_sysroot_simple_write_deployment (OstreeSysroot      *sysroot,
   gboolean ret = FALSE;
   guint i;
   OstreeDeployment *booted_deployment = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
-  gs_unref_ptrarray GPtrArray *new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
+  g_autoptr(GPtrArray) deployments = NULL;
+  g_autoptr(GPtrArray) new_deployments = g_ptr_array_new_with_free_func (g_object_unref);
   gboolean retain = (flags & OSTREE_SYSROOT_SIMPLE_WRITE_DEPLOYMENT_FLAGS_RETAIN) > 0;
 
   deployments = ostree_sysroot_get_deployments (sysroot);
index 2693eecb8f7f77a11947c65f6e0557ce5f85153b..1143ca9054cb4080e79a860debc59470c0a972dd 100644 (file)
@@ -57,7 +57,7 @@ ot_gfile_from_build_path (const char *first, ...)
   va_list args;
   const char *arg;
   g_autofree char *path = NULL;
-  gs_unref_ptrarray GPtrArray *components = NULL;  
+  g_autoptr(GPtrArray) components = NULL;  
 
   va_start (args, first);
 
@@ -114,7 +114,7 @@ ot_gfile_get_child_build_path (GFile      *parent,
   va_list args;
   const char *arg;
   g_autofree char *path = NULL;
-  gs_unref_ptrarray GPtrArray *components = NULL;  
+  g_autoptr(GPtrArray) components = NULL;  
 
   va_start (args, first);
 
index 9ba0dc38c0e18fc9fd188ce7466fcce6452386ac..4f659a271fae0203c509c00c654897a7640d91de 100644 (file)
@@ -91,7 +91,7 @@ ot_util_path_split_validate (const char *path,
 {
   gboolean ret = FALSE;
   int i;
-  gs_unref_ptrarray GPtrArray *ret_components = NULL;
+  g_autoptr(GPtrArray) ret_components = NULL;
 
   if (strlen (path) > PATH_MAX)
     {
index 6fc0deb296ba44172f9439e8aab07a80802244e5..27705982bb82b084cf5cf367c3572c27474e6e2c 100644 (file)
@@ -58,7 +58,7 @@ ot_admin_builtin_deploy (int argc, char **argv, GCancellable *cancellable, GErro
   glnx_unref_object OstreeSysroot *sysroot = NULL;
   GKeyFile *origin = NULL;
   glnx_unref_object OstreeRepo *repo = NULL;
-  gs_unref_ptrarray GPtrArray *new_deployments = NULL;
+  g_autoptr(GPtrArray) new_deployments = NULL;
   glnx_unref_object OstreeDeployment *new_deployment = NULL;
   glnx_unref_object OstreeDeployment *merge_deployment = NULL;
   g_autofree char *revision = NULL;
index cb45c8062031c4e39a5b904f6bbd86e152ff571c..58d771a6814bc07d489679c42b56bbbb35c10e77 100644 (file)
@@ -45,9 +45,9 @@ ot_admin_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError
   gboolean ret = FALSE;
   glnx_unref_object OstreeDeployment *deployment = NULL;
   g_autoptr(GFile) deployment_dir = NULL;
-  gs_unref_ptrarray GPtrArray *modified = NULL;
-  gs_unref_ptrarray GPtrArray *removed = NULL;
-  gs_unref_ptrarray GPtrArray *added = NULL;
+  g_autoptr(GPtrArray) modified = NULL;
+  g_autoptr(GPtrArray) removed = NULL;
+  g_autoptr(GPtrArray) added = NULL;
   g_autoptr(GFile) orig_etc_path = NULL;
   g_autoptr(GFile) new_etc_path = NULL;
 
index 9dac4da971dfaebde97ea7d26cbeb886ff878dcb..ce9263b919d66899b509c114eed43e2d0fbdbfe5 100644 (file)
@@ -89,7 +89,7 @@ ot_admin_builtin_status (int argc, char **argv, GCancellable *cancellable, GErro
   gboolean ret = FALSE;
   glnx_unref_object OstreeRepo *repo = NULL;
   OstreeDeployment *booted_deployment = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
   guint i;
 
   context = g_option_context_new ("List deployments");
index 39ae073304a9e054e211a48086dfe0b09b7ef7d3..e048729d61c4bbd4ae550328ae3b49d9d3986a83 100644 (file)
@@ -40,7 +40,7 @@ ot_admin_builtin_undeploy (int argc, char **argv, GCancellable *cancellable, GEr
   glnx_unref_object OstreeSysroot *sysroot = NULL;
   const char *deploy_index_str;
   int deploy_index;
-  gs_unref_ptrarray GPtrArray *current_deployments = NULL;
+  g_autoptr(GPtrArray) current_deployments = NULL;
   glnx_unref_object OstreeDeployment *booted_deployment = NULL;
   glnx_unref_object OstreeDeployment *target_deployment = NULL;
 
index 78ef8b1d7e885f01ce038da20011c7f3aef8bca9..22c25e543dac3675f3ace8b3ac6dc3f74fcb0d35 100644 (file)
@@ -78,7 +78,7 @@ ot_admin_get_indexed_deployment (OstreeSysroot  *sysroot,
                                  GError        **error)
 
 {
-  gs_unref_ptrarray GPtrArray *current_deployments =
+  g_autoptr(GPtrArray) current_deployments =
     ostree_sysroot_get_deployments (sysroot);
 
   if (index < 0)
index 832ac069a769f1c992f3d1dd979c342844861885..5e82d3735deda69507aa5531780285d6d3b4147d 100644 (file)
@@ -40,7 +40,7 @@ ot_admin_instutil_builtin_grub2_generate (int argc, char **argv, GCancellable *c
   guint bootversion;
   g_autoptr(GFile) subpath = NULL;
   glnx_unref_object OstreeSePolicy *sepolicy = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
   GOptionContext *context = NULL;
   glnx_unref_object OstreeSysroot *sysroot = NULL;
   g_autoptr(GFile) deployment_path = NULL;
index 471410cd850ed1aa7ea8a19b6dc264377bf93091..457e615e88d3497b518c010cb645602453be8481 100644 (file)
@@ -152,7 +152,7 @@ selinux_relabel_dir (OstreeSePolicy                *sepolicy,
                      GError                       **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *path_parts = g_ptr_array_new ();
+  g_autoptr(GPtrArray) path_parts = g_ptr_array_new ();
   g_autoptr(GFileInfo) root_info = NULL;
 
   root_info = g_file_query_info (dir, OSTREE_GIO_FAST_QUERYINFO,
@@ -186,7 +186,7 @@ ot_admin_instutil_builtin_selinux_ensure_labeled (int argc, char **argv, GCancel
   g_autoptr(GFile) subpath = NULL;
   const char *prefix = NULL;
   glnx_unref_object OstreeSePolicy *sepolicy = NULL;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
   OstreeDeployment *first_deployment;
   GOptionContext *context = NULL;
   glnx_unref_object OstreeSysroot *sysroot = NULL;
index a985979f5816590c087cff4525eb443b2a920c40..bb10e8e7772734c1c4c0d0e1187228ff70fe4124 100644 (file)
@@ -48,7 +48,7 @@ ot_admin_instutil_builtin_set_kargs (int argc, char **argv, GCancellable *cancel
 {
   gboolean ret = FALSE;
   guint i;
-  gs_unref_ptrarray GPtrArray *deployments = NULL;
+  g_autoptr(GPtrArray) deployments = NULL;
   OstreeDeployment *first_deployment = NULL;
   GOptionContext *context = NULL;
   glnx_unref_object OstreeSysroot *sysroot = NULL;
index 8e2d237a1344ba77b8bbb4472cf484a8afe2df43..fb74423981650aff64e8f86daeba7e0eb2b095de 100644 (file)
@@ -126,9 +126,9 @@ ostree_builtin_diff (int argc, char **argv, GCancellable *cancellable, GError **
   g_autofree char *src_prev = NULL;
   g_autoptr(GFile) srcf = NULL;
   g_autoptr(GFile) targetf = NULL;
-  gs_unref_ptrarray GPtrArray *modified = NULL;
-  gs_unref_ptrarray GPtrArray *removed = NULL;
-  gs_unref_ptrarray GPtrArray *added = NULL;
+  g_autoptr(GPtrArray) modified = NULL;
+  g_autoptr(GPtrArray) removed = NULL;
+  g_autoptr(GPtrArray) added = NULL;
 
   context = g_option_context_new ("REV TARGETDIR - Compare directory TARGETDIR against revision REV");
   g_option_context_add_main_entries (context, options, NULL);
index ec0c00421a49ab988790a14e4c5f10282a4e00e5..94db6917460a237ba605a993f80120bc717c99c1 100644 (file)
@@ -50,7 +50,7 @@ ostree_builtin_pull_local (int argc, char **argv, GCancellable *cancellable, GEr
   GSConsole *console = NULL;
   g_autofree char *src_repo_uri = NULL;
   glnx_unref_object OstreeAsyncProgress *progress = NULL;
-  gs_unref_ptrarray GPtrArray *refs_to_fetch = NULL;
+  g_autoptr(GPtrArray) refs_to_fetch = NULL;
   g_autoptr(GHashTable) source_objects = NULL;
 
   context = g_option_context_new ("SRC_REPO [REFS...] -  Copy data from SRC_REPO");
index e19ef3c14e73349578a54c65e83036dbd1c0e334..424ba412f87bc18cbed6683eaf47d3899744bc4c 100644 (file)
@@ -63,7 +63,7 @@ ostree_builtin_pull (int argc, char **argv, GCancellable *cancellable, GError **
   g_autofree char *remote = NULL;
   OstreeRepoPullFlags pullflags = 0;
   GSConsole *console = NULL;
-  gs_unref_ptrarray GPtrArray *refs_to_fetch = NULL;
+  g_autoptr(GPtrArray) refs_to_fetch = NULL;
   glnx_unref_object OstreeAsyncProgress *progress = NULL;
   gulong signal_handler_id = 0;
 
index ad884e91e1695bf2fb2a0d2d26377133edee514e..f4fa26f035c839c1af64ebb60a373d956a953d2d 100644 (file)
@@ -97,7 +97,7 @@ static gboolean
 ot_static_delta_builtin_list (int argc, char **argv, GCancellable *cancellable, GError **error)
 {
   gboolean ret = FALSE;
-  gs_unref_ptrarray GPtrArray *delta_names = NULL;
+  g_autoptr(GPtrArray) delta_names = NULL;
   guint i;
   GOptionContext *context;
   glnx_unref_object OstreeRepo *repo = NULL;
index f0fcacea948375a988542289f71f0b4bd0b85413..80af2117de6e6626627f732671563c5a75044d99 100644 (file)
@@ -339,7 +339,7 @@ ostree_admin_option_context_parse (GOptionContext *context,
 
   if (opt_print_current_dir)
     {
-      gs_unref_ptrarray GPtrArray *deployments = NULL;
+      g_autoptr(GPtrArray) deployments = NULL;
       OstreeDeployment *first_deployment;
       g_autoptr(GFile) deployment_file = NULL;
       g_autofree char *deployment_path = NULL;
index 64d8d3072dc7c1f3b2feed51766ca724a79e106f..475430f789bd8b9774f26a58c54980bff609a6f7 100644 (file)
@@ -46,7 +46,7 @@ test_mutable_tree_walk (void)
 {
   glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
   glnx_unref_object OstreeMutableTree *parent = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
   GError *error = NULL;
   const char *pathname = "a/b/c/d/e/f/g/i";
   const char *checksum = "01234567890123456789012345678901";
@@ -84,7 +84,7 @@ test_ensure_parent_dirs (void)
 {
   glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
   glnx_unref_object OstreeMutableTree *parent = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
   GError *error = NULL;
   const char *pathname = "/foo/bar/baz";
   const char *checksum = "01234567890123456789012345678901";
@@ -111,7 +111,7 @@ test_ensure_dir (void)
 {
   glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
   glnx_unref_object OstreeMutableTree *parent = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
   GError *error = NULL;
   const char *dirname = "foo";
   const char *filename = "bar";
@@ -131,7 +131,7 @@ test_replace_file (void)
 {
   glnx_unref_object OstreeMutableTree *tree = ostree_mutable_tree_new ();
   glnx_unref_object OstreeMutableTree *parent = NULL;
-  gs_unref_ptrarray GPtrArray *split_path = NULL;
+  g_autoptr(GPtrArray) split_path = NULL;
   GError *error = NULL;
   const char *filename = "bar";
   const char *checksum = "01234567890123456789012345678901";
index e2125142c6112b66d9b02ad0e21cb0757cd22af2..42b14ec6ddd1b9ac22b154ddd9c98997b723b106 100644 (file)
@@ -34,7 +34,7 @@ test_ot_util_path_split_validate (void)
   for (i = 0; paths[i]; i++)
     {
       GError *error = NULL;
-      GPtrArray *components = NULL;
+      g_autoptr(GPtrArray) components = NULL;
       if (! ot_util_path_split_validate (paths[i], &components, &error))
         {
           int j;
@@ -45,7 +45,6 @@ test_ot_util_path_split_validate (void)
               g_assert_null (strchr (components->pdata[i], '/'));
             }
         }
-      gs_local_ptrarray_unref (components);
     }
 }